<extend name="Public/base" />

<block name="body">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title cf">
        <h2>店铺编辑</h2>
    </div>
    <!-- 标签页导航 ff-->
<div class="tab-wrap">
    <div class="tab-content">
	        <div id="level_style" style="background-color:#{$shopinfo.shop_color};" >
            <div id="pic">
                <img id="img_level" src="/Public/Admin/images/123.png" alt="">
            </div>
            <span id="shop_name" >{$shopinfo.shop_name}</span>
            <span id="member_id" >NO.123456</span>
            <span id="level_number">会员积分：0</span>
        </div>
    <!-- 表单 -->
    <form id="form" action="{:U('edit')}" method="post" class="form-horizontal">
        <div class="form-item">
            <label class="item-label">用户名<span class="check-tips">（不可更改）</span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="username" value="{$username}" readonly="true">
            </div>
        </div>

        <div class="form-item">
            <label class="item-label">店铺名称<span class="check-tips">（店铺全称）</span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="shop_name" value="{$shopinfo.shop_name}">
            </div>
        </div>

        <div class="form-item">
            <label class="item-label">店铺地址<span class="check-tips">（店铺所在详细地址）</span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="shop_addr" value="{$shopinfo.shop_addr}">
            </div>
        </div>

        <div class="form-item">
            <label class="item-label">所属总店<span class="check-tips">（店铺所属的连锁店或总店名称）</span></label>
            <div class="controls">
                <select name="type_id" id="type_select">
                    <volist name="type" id="vo">
                        <option value="{$vo.type_id}" <eq name="vo['type_id']" value="$shopinfo['type_id']">selected</eq>>{$vo.name}</option>
                    </volist>
                </select>
            </div>
        </div>

        <div class="form-item cf">
            <input type="hidden" name="id" value="{$shopinfo.id}">
            <button class="btn submit-btn ajax-post hidden" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <a class="btn btn-return" href="javascript:history.back(-1);">返 回</a>
        </div>
    </form>
    </div>
</div>
</block>


<block name="script">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/level.css" media="all">
<link rel="stylesheet" type="text/css" href="/Public/Admin/iColor/css/colpick.css" media="all">
<script src="/Public/Admin/iColor/js/colpick.js"></script>
<script type="text/javascript">
$('#submit').click(function(){
    $('#form').submit();
});
$("#type_select").change(function(){
    if($(this).val() == -1){
        $("#add_type").removeClass("hidden");
    }else{
        $("#add_type").addClass("hidden");
    }
})

$("#Headquarters").bind("blur",function(){

    var v = $(this).val();
    $("#shop_name").text(v);
    });

$('#picker').colpick({

	layout:'hex',

	submit:0,

	colorScheme:'dark',

	onChange:function(hsb,hex,rgb,el,bySetColor) {

		$(el).css('border-color','#'+hex);

		// Fill the text box just if the color was set using the picker, and not the colpickSetColor function.

		if(!bySetColor) $(el).val(hex);

	}

}).keyup(function(){

	$(this).colpickSetColor(this.value);

});
$('#picker').bind("blur",function(){
	
	var clr = $(this).val();
	var _clr = '#'+clr;
	$('#level_style').css('background-color',_clr);
});

</script>
</block>